from tkinter import *

class MenuDemo:
    def __init__(self):
        window = Tk()

        window.title("menu demo")

        menubar = Menu(window)

        window.config(menu = menubar)

        operationMenu = Menu(menubar,tearoff=0)
        menubar.add_cascade(label='operation',menu=operationMenu)
        operationMenu.add_command(label='add',command=self.add)
        operationMenu.add_command(label='subtract',command=self.subtract)
        operationMenu.add_separator()
        operationMenu.add_command(label='multiply',command = self.multiply)
        operationMenu.add_command(label='divide',command = self.divide)

        exitmenu = Menu(menubar,tearoff = 0)
        menubar.add_cascade(label='exit',menu=exitmenu)
        exitmenu.add_command(label='quit',command=window.quit)


        frame0 = Frame(window)

        frame0.grid(row=1,column = 1,sticky=W)







        window.mainloop()
    def add(self):

        return
    def subtract(self):

        return
    def multiply(self):

        return
    def divide(self):
        return
MenuDemo()